package routers

import (
	"github.com/astaxie/beego"
	"lphoto/controllers/admin"
	"lphoto/controllers/index"
)

func init() {
    indexRouter()
    adminRouter()
}

func indexRouter()  {
	beego.Router("/", &index.IndexController{},"get:Index")
	beego.Router("/index/index/getProduct", &index.IndexController{},"*:GetProduct")
}
func adminRouter()  {
	beego.Router("/admin", &admin.IndexController{},"get:Index")
	beego.Router("/admin/login", &admin.LoginController{},"get:Index")
	beego.Router("/admin/login/logout", &admin.LoginController{},"get:Logout")
	beego.Router("/admin/login/doLogin", &admin.LoginController{},"*:DoLogin")

	beego.Router("/admin/mine", &admin.MineController{}, "get:Index")
	beego.Router("/admin/mine/modifyPassword", &admin.MineController{}, "get:ModifyPassword")

	beego.Router("/admin/product", &admin.ProductController{}, "get:Index")
	beego.Router("/admin/product/upload", &admin.ProductController{}, "get:Upload")
	beego.Router("/admin/product/getOss", &admin.ProductController{}, "*:GetOss")
	beego.Router("/admin/product/doUpload", &admin.ProductController{}, "post:DoUpload")
	beego.Router("/admin/product/delProduct", &admin.ProductController{}, "post:DelProduct")
}